﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="ElectronicRecords.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ViewShedules
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <center><h2><a href= "<%=Url.RequestContext.RouteData.Values["id"].ToString()%>?date=<%=((DateTime)ViewData["date_begin"] - new TimeSpan(2, 0, 0, 0)).ToShortDateString()%>"><img height="24" width="24" src="../../img/Prev.png" ></a>&nbsp&nbsp&nbsp Расписание работы специалиста c <%=ViewData["date_begin"]%> по <%=ViewData["date_end"]%> &nbsp&nbsp&nbsp  <a href= "<%=Url.RequestContext.RouteData.Values["id"].ToString()%>?date=<%=((DateTime)ViewData["date_end"] + new TimeSpan(2, 0, 0, 0)).ToShortDateString()%>"><img height="24" width="24" src="../../img/Next.png" ></a> </h2></center>

    <center><h2><%=Html.ActionLink("Создать расписание", "CreateShedules/" + Url.RequestContext.RouteData.Values["id"].ToString())%>  &nbsp&nbsp&nbsp&nbsp&nbsp                          
     <%=Html.ActionLink("Перейти в графический режим", "CreateShedules/" + Url.RequestContext.RouteData.Values["id"].ToString())%>
    
    </h2></center>
      
    <table id="maintable" >
        <tr>
            <th style="width:10%">
                Действие
            </th>
            <th style="width:10%">
                ID
            </th>
            <th style="width:40%">
                Дата
            </th>
             <th style="width:20%">
                С
            </th>
            <th style="width:20%">
                По
            </th>
        </tr>
        <% foreach (Shedules s in (IEnumerable<Shedules>)ViewData["Shedules"])
           {%>
        <tr>
            <td>
                <%=Html.ActionLink("Открыть", "EditShedules", new { id = s.ID_Shedules, specialist_id=s.ID_Specialist })%>
            </td>
            <td>
                <%=s.ID_Shedules %>
            </td>
            <td>
                <%=s.Date_Begin.ToShortDateString() %>
            </td>
             <td>
                <%=s.Date_Begin.TimeOfDay %>
            </td>
            <td>
                <%=s.Date_End.TimeOfDay %>
            </td>
        </tr>
        <%} %>
    </table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
